# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=clap
pkgver=1.1.10
pkgrel=1
pkgdesc="CLever Audio Plugin API"
arch=(any)
url="https://github.com/free-audio/clap"
license=(MIT)
makedepends=(cmake)
source=($pkgname-$pkgver.tar.gz::$url/archive/refs/tags/$pkgver.tar.gz)
sha512sums=('50d2b8e35ebcb3dfd4e057ddcf22e92204ca90a700527fe802c7f3ae678e77c970f789f2fbbedd58964a1d1ec72376e7c8d488c10fe03d39fbd1cd5d6a8630a1')
b2sums=('0c0b948cb8171f52953f2ed8d4bccaca098c06c66b2a795c0007459424204e92b1b1b92b8607de202d84eeae5619d0b6887269e43ea2db988e4ef6a1c9738d96')

build() {
  local cmake_options=(
    -B build
    -D CMAKE_BUILD_TYPE=None
    -D CMAKE_INSTALL_PREFIX=/usr
    -S $pkgname-$pkgver
    -W no-dev
  )

  cmake "${cmake_options[@]}"
  cmake --build build
}

check() {
  ctest --test-dir build --output-on-failure
}

package() {
  DESTDIR="$pkgdir" cmake --install build
  install -vDm 644 $pkgname-$pkgver/LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
}
